<template>
  <!-- 顶部通栏 -->
  <AppNavbar/>
  <!-- 头部组件 -->
  <AppHeader/>
  <!-- 吸顶 -->
  <AppHeaderSticky/>

  <!-- 内容容器 -->
  <div class="app_body">
    <!-- 二级路由 -->
    <router-view v-slot="{Component}">
          <component :is="Component" v-if="!$route.meta.keepAlive"></component>
        <keep-alive>
          <component :is="Component" v-if="$route.meta.keepAlive"></component>
        </keep-alive>
      </router-view>
  </div>
  <!-- 底部组件 -->
  <AppFooter/>
</template>

<script>
import AppNavbar from '@/components/AppNavbar.vue'
import AppHeader from '@/components/AppHeader.vue';
import AppFooter from '@/components/AppFooter.vue';
import AppHeaderSticky from '@/components/AppHeaderSticky';
import { useStore } from 'vuex';
export default {
  name: 'layout',
  components: { AppNavbar, AppHeader, AppFooter, AppHeaderSticky },
  setup(props) {
    const store = useStore()
    store.dispatch('category/getList')
  }
}
</script>

<style scoped lang="scss">

</style>
